﻿using Xunit;

namespace Unity.String.Tests
{
    public class Uft16PreparedFormatTest
    {
        [Fact]
        public void FormatTest()
        {
            string testFormatStringArgs1 = "Test: {0}, {1}";
            Utf16PreparedFormat<int> testUtf16PreparedTestArgs1 =
                new Utf16PreparedFormat<int>(testFormatStringArgs1);
            Assert.Equal(testFormatStringArgs1, testUtf16PreparedTestArgs1.FormatString);
            int testCalculatedMinSizeArgs1 = 8;
            Assert.Equal(testCalculatedMinSizeArgs1, testUtf16PreparedTestArgs1.MinSize);
            string testArgs1FormatResult = testUtf16PreparedTestArgs1.Format(1);
            string testResultStringArgs1 = "Test: 1, ";
            Assert.Equal(testResultStringArgs1, testArgs1FormatResult);
            
            string testFormatStringArgs2 = "Test: {0}, {1}, {2}";
            Utf16PreparedFormat<int, int> testUtf16PreparedTestArgs2 =
                new Utf16PreparedFormat<int, int>(testFormatStringArgs2);
            Assert.Equal(testFormatStringArgs2, testUtf16PreparedTestArgs2.FormatString);
            int testCalculatedMinSizeArgs2 = 10;
            Assert.Equal(testCalculatedMinSizeArgs2, testUtf16PreparedTestArgs2.MinSize);
            string testArgs2FormatResult = testUtf16PreparedTestArgs2.Format(1, 2);
            string testResultStringArgs2 = "Test: 1, 2, ";
            Assert.Equal(testResultStringArgs2, testArgs2FormatResult);
            
            string testFormatStringArgs3 = "Test: {0}, {1}, {2}, {3}";
            Utf16PreparedFormat<int, int, int> testUtf16PreparedTestArgs3 =
                new Utf16PreparedFormat<int, int, int>(testFormatStringArgs3);
            Assert.Equal(testFormatStringArgs3, testUtf16PreparedTestArgs3.FormatString);
            int testCalculatedMinSizeArgs3 = 12;
            Assert.Equal(testCalculatedMinSizeArgs3, testUtf16PreparedTestArgs3.MinSize);
            string testArgs3FormatResult = testUtf16PreparedTestArgs3.Format(1, 2, 3);
            string testResultStringArgs3 = "Test: 1, 2, 3, ";
            Assert.Equal(testResultStringArgs3, testArgs3FormatResult);
            
            string testFormatStringArgs4 = "Test: {0}, {1}, {2}, {3}, {4}";
            Utf16PreparedFormat<int, int, int, int> testUtf16PreparedTestArgs4 =
                new Utf16PreparedFormat<int, int, int, int>(testFormatStringArgs4);
            Assert.Equal(testFormatStringArgs4, testUtf16PreparedTestArgs4.FormatString);
            int testCalculatedMinSizeArgs4 = 14;
            Assert.Equal(testCalculatedMinSizeArgs4, testUtf16PreparedTestArgs4.MinSize);
            string testArgs4FormatResult = testUtf16PreparedTestArgs4.Format(1, 2, 3, 4);
            string testResultStringArgs4 = "Test: 1, 2, 3, 4, ";
            Assert.Equal(testResultStringArgs4, testArgs4FormatResult);
            
            string testFormatStringArgs5 = "Test: {0}, {1}, {2}, {3}, {4}, {5}";
            Utf16PreparedFormat<int, int, int, int, int> testUtf16PreparedTestArgs5 =
                new Utf16PreparedFormat<int, int, int, int, int>(testFormatStringArgs5);
            Assert.Equal(testFormatStringArgs5, testUtf16PreparedTestArgs5.FormatString);
            int testCalculatedMinSizeArgs5 = 16;
            Assert.Equal(testCalculatedMinSizeArgs5, testUtf16PreparedTestArgs5.MinSize);
            string testArgs5FormatResult = testUtf16PreparedTestArgs5.Format(1, 2, 3, 4, 5);
            string testResultStringArgs5 = "Test: 1, 2, 3, 4, 5, ";
            Assert.Equal(testResultStringArgs5, testArgs5FormatResult);
            
            string testFormatStringArgs6 = "Test: {0}, {1}, {2}, {3}, {4}, {5}, {6}";
            Utf16PreparedFormat<int, int, int, int, int, int> testUtf16PreparedTestArgs6 =
                new Utf16PreparedFormat<int, int, int, int, int, int>(testFormatStringArgs6);
            Assert.Equal(testFormatStringArgs6, testUtf16PreparedTestArgs6.FormatString);
            int testCalculatedMinSizeArgs6 = 18;
            Assert.Equal(testCalculatedMinSizeArgs6, testUtf16PreparedTestArgs6.MinSize);
            string testArgs6FormatResult = testUtf16PreparedTestArgs6.Format(1, 2, 3, 4, 5, 6);
            string testResultStringArgs6 = "Test: 1, 2, 3, 4, 5, 6, ";
            Assert.Equal(testResultStringArgs6, testArgs6FormatResult);
            
            string testFormatStringArgs7 = "Test: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}";
            Utf16PreparedFormat<int, int, int, int, int, int, int> testUtf16PreparedTestArgs7 =
                new Utf16PreparedFormat<int, int, int, int, int, int, int>(testFormatStringArgs7);
            Assert.Equal(testFormatStringArgs7, testUtf16PreparedTestArgs7.FormatString);
            int testCalculatedMinSizeArgs7 = 20;
            Assert.Equal(testCalculatedMinSizeArgs7, testUtf16PreparedTestArgs7.MinSize);
            string testArgs7FormatResult = testUtf16PreparedTestArgs7.Format(1, 2, 3, 4, 5, 6, 7);
            string testResultStringArgs7 = "Test: 1, 2, 3, 4, 5, 6, 7, ";
            Assert.Equal(testResultStringArgs7, testArgs7FormatResult);
            
            string testFormatStringArgs8 = "Test: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}";
            Utf16PreparedFormat<int, int, int, int, int, int, int, int> testUtf16PreparedTestArgs8 =
                new Utf16PreparedFormat<int, int, int, int, int, int, int, int>(testFormatStringArgs8);
            Assert.Equal(testFormatStringArgs8, testUtf16PreparedTestArgs8.FormatString);
            int testCalculatedMinSizeArgs8 = 22;
            Assert.Equal(testCalculatedMinSizeArgs8, testUtf16PreparedTestArgs8.MinSize);
            string testArgs8FormatResult = testUtf16PreparedTestArgs8.Format(1, 2, 3, 4, 5, 6, 7, 8);
            string testResultStringArgs8 = "Test: 1, 2, 3, 4, 5, 6, 7, 8, ";
            Assert.Equal(testResultStringArgs8, testArgs8FormatResult);
            
            string testFormatStringArgs9 = "Test: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}";
            Utf16PreparedFormat<int, int, int, int, int, int, int, int, int> testUtf16PreparedTestArgs9 =
                new Utf16PreparedFormat<int, int, int, int, int, int, int, int, int>(testFormatStringArgs9);
            Assert.Equal(testFormatStringArgs9, testUtf16PreparedTestArgs9.FormatString);
            int testCalculatedMinSizeArgs9 = 24;
            Assert.Equal(testCalculatedMinSizeArgs9, testUtf16PreparedTestArgs9.MinSize);
            string testArgs9FormatResult = testUtf16PreparedTestArgs9.Format(1, 2, 3, 4, 5, 6, 7, 8, 9);
            string testResultStringArgs9 = "Test: 1, 2, 3, 4, 5, 6, 7, 8, 9, ";
            Assert.Equal(testResultStringArgs9, testArgs9FormatResult);
            
            string testFormatStringArgs10 = "Test: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}";
            Utf16PreparedFormat<int, int, int, int, int, int, int, int, int, int> testUtf16PreparedTestArgs10 =
                new Utf16PreparedFormat<int, int, int, int, int, int, int, int, int, int>(testFormatStringArgs10);
            Assert.Equal(testFormatStringArgs10, testUtf16PreparedTestArgs10.FormatString);
            int testCalculatedMinSizeArgs10 = 26;
            Assert.Equal(testCalculatedMinSizeArgs10, testUtf16PreparedTestArgs10.MinSize);
            string testArgs10FormatResult = testUtf16PreparedTestArgs10.Format(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
            string testResultStringArgs10 = "Test: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ";
            Assert.Equal(testResultStringArgs10, testArgs10FormatResult);
            
            string testFormatStringArgs11 = "Test: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}";
            Utf16PreparedFormat<int, int, int, int, int, int, int, int, int, int, int> testUtf16PreparedTestArgs11 =
                new Utf16PreparedFormat<int, int, int, int, int, int, int, int, int, int, int>(testFormatStringArgs11);
            Assert.Equal(testFormatStringArgs11, testUtf16PreparedTestArgs11.FormatString);
            int testCalculatedMinSizeArgs11 = 28;
            Assert.Equal(testCalculatedMinSizeArgs11, testUtf16PreparedTestArgs11.MinSize);
            string testArgs11FormatResult = testUtf16PreparedTestArgs11.Format(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
            string testResultStringArgs11 = "Test: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ";
            Assert.Equal(testResultStringArgs11, testArgs11FormatResult);
            
            string testFormatStringArgs12 = "Test: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}";
            Utf16PreparedFormat<int, int, int, int, int, int, int, int, int, int, int, int> testUtf16PreparedTestArgs12 =
                new Utf16PreparedFormat<int, int, int, int, int, int, int, int, int, int, int, int>(testFormatStringArgs12);
            Assert.Equal(testFormatStringArgs12, testUtf16PreparedTestArgs12.FormatString);
            int testCalculatedMinSizeArgs12 = 30;
            Assert.Equal(testCalculatedMinSizeArgs12, testUtf16PreparedTestArgs12.MinSize);
            string testArgs12FormatResult = testUtf16PreparedTestArgs12.Format(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
            string testResultStringArgs12 = "Test: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ";
            Assert.Equal(testResultStringArgs12, testArgs12FormatResult);
            
            string testFormatStringArgs13 = "Test: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13}";
            Utf16PreparedFormat<int, int, int, int, int, int, int, int, int, int, int, int, int> testUtf16PreparedTestArgs13 =
                new Utf16PreparedFormat<int, int, int, int, int, int, int, int, int, int, int, int, int>(testFormatStringArgs13);
            Assert.Equal(testFormatStringArgs13, testUtf16PreparedTestArgs13.FormatString);
            int testCalculatedMinSizeArgs13 = 32;
            Assert.Equal(testCalculatedMinSizeArgs13, testUtf16PreparedTestArgs13.MinSize);
            string testArgs13FormatResult = testUtf16PreparedTestArgs13.Format(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13);
            string testResultStringArgs13 = "Test: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, ";
            Assert.Equal(testResultStringArgs13, testArgs13FormatResult);
            
            string testFormatStringArgs14 = "Test: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13}, {14}";
            Utf16PreparedFormat<int, int, int, int, int, int, int, int, int, int, int, int, int, int> testUtf16PreparedTestArgs14 =
                new Utf16PreparedFormat<int, int, int, int, int, int, int, int, int, int, int, int, int, int>(testFormatStringArgs14);
            Assert.Equal(testFormatStringArgs14, testUtf16PreparedTestArgs14.FormatString);
            int testCalculatedMinSizeArgs14 = 34;
            Assert.Equal(testCalculatedMinSizeArgs14, testUtf16PreparedTestArgs14.MinSize);
            string testArgs14FormatResult = testUtf16PreparedTestArgs14.Format(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14);
            string testResultStringArgs14 = "Test: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, ";
            Assert.Equal(testResultStringArgs14, testArgs14FormatResult);
            
            string testFormatStringArgs15 = "Test: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13}, {14}, {15}";
            Utf16PreparedFormat<int, int, int, int, int, int, int, int, int, int, int, int, int, int, int> testUtf16PreparedTestArgs15 =
                new Utf16PreparedFormat<int, int, int, int, int, int, int, int, int, int, int, int, int, int, int>(testFormatStringArgs15);
            Assert.Equal(testFormatStringArgs15, testUtf16PreparedTestArgs15.FormatString);
            int testCalculatedMinSizeArgs15 = 36;
            Assert.Equal(testCalculatedMinSizeArgs15, testUtf16PreparedTestArgs15.MinSize);
            string testArgs15FormatResult = testUtf16PreparedTestArgs15.Format(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
            string testResultStringArgs15 = "Test: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, ";
            Assert.Equal(testResultStringArgs15, testArgs15FormatResult);
            
            string testFormatStringArgs16 = "Test: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13}, {14}, {15}";
            Utf16PreparedFormat<int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int> testUtf16PreparedTestArgs16 =
                new Utf16PreparedFormat<int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int>(testFormatStringArgs16);
            Assert.Equal(testFormatStringArgs16, testUtf16PreparedTestArgs16.FormatString);
            int testCalculatedMinSizeArgs16 = 36;
            Assert.Equal(testCalculatedMinSizeArgs16, testUtf16PreparedTestArgs16.MinSize);
            string testArgs16FormatResult = testUtf16PreparedTestArgs16.Format(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
            string testResultStringArgs16 = "Test: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16";
            Assert.Equal(testResultStringArgs16, testArgs16FormatResult);
        }
    }
}